<template>
<div class="base-container">
    <el-container>
        <el-header>
            <head-nav></head-nav>
        </el-header>
        <el-container>
            <el-aside width="60px">
                <nav-menu></nav-menu>
            </el-aside>
            <el-container>
                <el-main>
                    <bread-crumb></bread-crumb>
                    <router-view />
                </el-main>
            </el-container>
        </el-container>
    </el-container>
</div>
</template>

<script>
import NavMenu from '@/views/menu/NavMenu'
import HeadNav from '@/views/menu/HeadNav'
import BreadCrumb from '@/views/menu/BreadCrumb'
export default {
    name: 'container',
    components: {
        NavMenu,
        HeadNav,
        BreadCrumb
    },
    data () {
        return {
            isCollapse: false
        }
    },
    methods: {
        handleIsCollapse (val) {
            this.isCollapse = val
            // 主动触发窗口变化事件，让图表根据窗口变化而自适应
            if (document.createEvent) {
                const event = document.createEvent('HTMLEvents')
                event.initEvent('resize', true, true)
                window.dispatchEvent(event)
            } else if (document.createEventObject) {
                window.fireEvent('onresize')
            }
        }
    }
}
</script>

<style lang="less">
@import './common.less';

.base-container {
    width: 100%;
    height: 100%;

    .el-header {
        background-color: #070F1C;
        text-align: center;
        line-height: 60px;
    }

    .el-aside {
        text-align: center;
        line-height: 200px;
        overflow: hidden;
    }

    .el-container,
    .el-menu {
        width: 100%;
        height: 100%;
    }
    .el-main {
        background: #EBEEF5;
        position: relative;
    }

}
</style>
